<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BAAttributeCooker
 *
 * @author jianfeng
 */
class BAAttributeCooker extends BCooker {

    //put your code here
    public static function getAttributesInArray($attributes) {

        $retArray = array();

        if (is_array($attributes)) {
            foreach ($attributes as $attribute) {
                if ($attribute instanceof BAttribute) {
                    $name = $attribute->getName();
                    $value = $attribute->getValue();
                    $retArray[$name] = $value;
                }
            }
        }
        
        return $retArray;
    }

}
